#include <iostream>
#include <vector>
using namespace std;
int main() {
  std::vector<char> characters;

  characters.assign(5, 'a');
  cout << "size=" << characters.size()
       << "  capacity = " << characters.capacity()
       << "  ptr=" << characters.data() << endl;
  for (char c : characters) {
    std::cout << c << '\n';
  }

  characters.assign(8, 'b');
  cout << "size=" << characters.size()
       << "  capacity = " << characters.capacity()
       << "  ptr=" << characters.data() << endl;
  for (char c : characters) {
    std::cout << c << '\n';
  }

  characters.assign(5, 'a');
  cout << "size=" << characters.size()
       << "  capacity = " << characters.capacity()
       << "  ptr=" << characters.data() << endl;
  for (char c : characters) {
    std::cout << c << '\n';
  }

  characters.clear();
  characters.shrink_to_fit();
  cout << characters.size() << "  capacity = " << characters.capacity() << endl;

  characters.assign(3, 'c');
  cout << characters.size() << "  capacity = " << characters.capacity() << endl;
  for (char c : characters) {
    std::cout << c << '\n';
  }

  char name[]{"dingxuejun"};
  characters.assign(name, name + 10);
  cout << characters.size() << "  capacity = " << characters.capacity() << endl;
  for (char c : characters) {
    std::cout << c << '\n';
  }
  characters.shrink_to_fit();

  return 0;
}